package com.teamin.service.TaskRemind;

import com.teamin.service.BaseJob;
import com.teamin.service.MessageService;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import java.io.Serializable;

/**
 * Created by qfu on 2017/11/20.
 */
public class TaskJob implements BaseJob, Serializable {
    private static final long serialVersionUID = 1L;
    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private MessageService messageService;

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        Long taskId = (Long) context.getJobDetail().getJobDataMap().get("taskId");
        messageService.taskRemind(taskId,"");
    }

}